php registration form - limit emails [closed]

Posted by Daniel on Super User See other posts from Super User or by Daniel
Published on 2010-01-15T00:32:27Z Indexed on 2010/04/06 13:53 UTC
Read the original article Hit count: 252

Filed under:
|
|
|

i want to restrict certain emails to my website.

an example would be that i only want people with gmail accounts to register to my website.

{
     /* Check if valid email address */
     $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*"
             ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*"
             ."\.([a-z]{2,}){1}$";
     if(!eregi($regex,$subemail)){
        $form->setError($field, "* Email invalid");
     }
     $subemail = stripslashes($subemail);
  }

this is what i have so far to check if its a valid email.

© Super User or respective owner

Related posts about php

Related posts about html